<template>
	<view class="p_b_128">
		<noneData noneTitle="暂无分享数据~" v-if="listData.length === 0"></noneData>
		<view class="p_tb_8" v-else>
			<view class="list_wrapper" v-for="item in listData" :key="item.id">
				<view class="p_bg_f3 p_photo_96">
					<image :src="item.avatar_image" mode="aspectFill" class="p_full"></image>
				</view>
				<view class="p_flex_2">
					<view class="p_font_28 p_one_text">{{item.nickname}}</view>
					<view class="p_font_26 p_color_b2 p_margin_t_8">{{item.create_time}}</view>
				</view>
			</view>
		</view>
		<view class="p_bottom_fix">
			<button plain open-type="share" hover-class="none" class="p_btn">
				<view>分享好友 代理赚钱</view>
			</button>
		</view>
	</view>
</template>

<script>
	import noneData from '../../components/noneData.vue';

	export default {
		components: {
			noneData
		},
		data() {
			return {
				listData: [],
			}
		},
		onLoad() {
			this.getListData();
		},
		onShareAppMessage(res) {
			let openid = uni.getStorageSync('openid');
			if (res.from === 'button') { // 来自页面内分享按钮
				console.log(res.target)
			}
			return {
				title: '打印5分/页，全国范围包邮',
				path: '/pages/index/index?parentOpenid=' + openid,
				imageUrl: 'https://dy.sykj365.com/uploads/mini/fenxiang.png'
			}
		},
		methods: {
			getListData() {
				this.$http.post(this.$api.invitationRecord).then(res => {
					this.listData = res.data;
				})
			}
		}
	}
</script>

<style lang="less">
	.list_wrapper {
		display: flex;
		align-items: center;
		padding: 24rpx 32rpx;
	}
</style>